﻿@using Kunlun.BusinessLogic;
@model Kunlun.ViewModels.ViewConsumer_picViewModels
<link href="@Url.Content("~/Content/member/style.css")" rel="stylesheet" type="text/css" />
@{
	ViewBag.Title = "照片列表";
}
@section Head
{
	<link href="@Url.Content("~/Content/themes/base/jquery.ui.all.css")" type="text/css" rel="Stylesheet" />
	<script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.min.js")" type="text/javascript"></script>
	<script type="text/javascript">
		$(function () {
			$(".RemoveLink").click(function () {

				var recordToDelete = $(this).attr("data-id");
				if (recordToDelete != '') {
					$.post("/MyPhoto/MyPicDel", { "id": recordToDelete },
                    function (data) {
                    	$('#row-' + recordToDelete).fadeOut('slow');

                    });
				}
			});

			$(".ImageLink").click(function () {

				var o = document.body;
				var div = document.createElement("div");
				div.id = "dialog-modal"
				o.appendChild(div);


				$("#dialog:ui-dialog").dialog("destroy");
				var imgsrc = $(this).attr("data-id");
				var imgtitle = $(this).attr("data-title");
				$("#dialog-modal").dialog({
					width: 620,
					height: 600,
					modal: true,
					title: imgtitle

				});

				$("#dialog-modal").html("<img src=\"@WebLog.PhotoView/" + imgsrc + "\" />");


			});

		});
      
	</script>
	<style>
		#rightP
		{
			width: 770px;
			height: auto;
			float: left;
			margin: 0 0 30px 10px;
			_margin-left: 1px;
		}
		#rightP ul
		{
			width: 165px;
			height: 190px;
			list-style: none;
			float: left;
			text-align: center;
			margin: 0 0 15px 15px;
			_margin-left: 10px;
			border: 5px #edecec solid;
		}
		.photo
		{
			width: 165px;
			height: auto;
			margin-top: 10px;
		}
		.photo img
		{
			border: none;
		}
		.pInfo
		{
			width: 165px;
			height: auto;
			margin-top: 10px;
		}
		.PageDiv
		{
			width: 600px;
			height: 25px;
			clear: both;
			margin-left: 5px;
			_margin-left: 0;
		}
		.PageDiv a
		{
			width: 18px;
			height: 18px;
			line-height: 20px;
			display: block;
			text-align: center;
			border: 1px #ccc solid;
			text-decoration: none;
			float: left;
			margin-left: 10px;
		}
		.PageDiv a:hover
		{
			background: red;
		}
	</style>
}
<div id="content">
	@Html.Partial("_MymenuPartial")
	<fieldset class="right">
		<legend>照片列表</legend>
		@foreach (var item in Model.Pic) {
			<ul class="mrxc" id="row-@item.ID">
				<li class="photo"><a href="#" class="ImageLink" data-id="@item.ListPicUrl" data-title="@item.ImageAlt">
					@KunlunHtml.Image(item.ThumUrl, WebLog.PhotoView, "")
				</a></li>
				<li class="pInfo">
					@item.ImageAlt&nbsp;&nbsp;|&nbsp;&nbsp;<a href="#" class="RemoveLink" data-id=@item.ID>删除</a>
				</li>
			</ul>
  }
		</fieldset>
	@KunlunHtml.Pager(this.Html, ViewBag.Page, "MyPhoto", "MyPhotoList")
</div>
